home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 11 / CU Amiga Magazine's Super CD-ROM 11 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-06].iso / s / deleterange.pprx < prev    next >
Text File  |  1992-03-14  |  1KB  |  43 lines

  1. /*
  2. @BDeleteRange  @P@ICopyright Gold Disk Inc., February, 1992
  3.  
  4. Use this Genie to delete a range of pages.
  5. */
  6. cr = '0a'x
  7.  
  8. address command
  9. call SafeEndEdit.rexx()
  10. first = ppm_DocFirstPage()
  11. last = ppm_DocLastPage()
  12. form = "from:"first'0a'x "to:"last
  13.  
  14. form = ppm_GetForm("Enter Range Of Pages:", 5, form)
  15. if form = '' then exit_msg()
  16. parse var form startpage'0a'x endpage
  17.  
  18. if ~DataType(startpage, 'N') then exit_msg('Invalid Input:'startpage)
  19. if ~DataType(endpage, 'N') then exit_msg('Invalid Input:'endpage)
  20.  
  21. call ppm_AutoUpdate(0)
  22. if last = 0 then exit_msg()
  23. if startpage < first then exit_msg('Invalid Range')
  24. else if startpage > last then exit_msg('Invalid Range')
  25. if endpage < first then exit_msg('Invalid Range')
  26. else if endpage > last then exit_msg('Invalid Range')
  27.  
  28. if startpage > endpage then exit_msg('Invalid Range')
  29.  
  30. call ppm_DeletePage(startpage, endpage - startpage + 1)
  31.  
  32. exit_msg()
  33.  
  34. exit_msg:
  35. do
  36.     parse arg message
  37.  
  38.     if message ~= '' then call ppm_Inform(1, message,)
  39.     call ppm_AutoUpdate(1)
  40.     exit
  41. end
  42.  
  43.